

package tomkitty;

import java.net.*;
import java.io.*;

public class TkSocketWrapper extends Socket {

  protected Socket sock;
  protected TkHttpOutputStream os;

  public TkSocketWrapper(Socket sock, Response resp) {
    try {
      this.os = new TkHttpOutputStream(sock.getOutputStream(), resp);
      this.sock = sock;
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public Socket getUnderlyingSocket() {
    return sock;
  }

  public InetAddress getInetAddress() {
    return sock.getInetAddress();
  }

  public InetAddress getLocalAddress() {
    return sock.getLocalAddress();
  }

  public int getPort() {
    return sock.getPort();
  }

  public int getLocalPort() {
    return sock.getLocalPort();
  }

  public InputStream getInputStream() throws IOException {
    return sock.getInputStream();
  }

  public OutputStream getOutputStream() throws IOException {
    return os;
  }

}
  
  
    
  
